from django.urls import path
from rest_framework.routers import DefaultRouter
from .views import ResumeViewSet, ResumeTemplateViewSet, ResumeAnalysisViewSet
from .resume_upload_api import ResumeJobRecommendAPIView, upload_resume_simple
from .simple_rag_api import SimpleRAGAPIView, simple_rag_recommend
from .test_views import resume_upload_test, api_documentation

router = DefaultRouter()
router.register('resume', ResumeViewSet)
router.register('templates', ResumeTemplateViewSet, basename='template')
router.register('analysis', ResumeAnalysisViewSet, basename='analysis')

urlpatterns = [
    # 基于简历的RAG岗位推荐API
    path('recommend/', ResumeJobRecommendAPIView.as_view(), name='resume_job_recommend'),
    path('simple-recommend/', SimpleRAGAPIView.as_view(), name='simple_rag_recommend'),
    path('upload/simple/', upload_resume_simple, name='resume_upload_simple'),
    
    # 测试和文档页面
    path('test/', resume_upload_test, name='resume_upload_test'),
    path('docs/', api_documentation, name='api_documentation'),
]
urlpatterns += router.urls